Survey.Survey.cssType = "bootstrap";
//3
var surveyJSON = {
	locale: "zh-cn",
	pages: [{
			name: "page4",
			elements: [{
					type: "html",
					name: "question8",
					html: {
						"zh-cn": "<div class=\"container\">\n\t\t<p class=\"lead\"></p>\n\t\t\n\t\t<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您好！我们是国家科技基础资源调查项目《我国中部地区脑出血发病率及危险因素基础数据调查》的调查员，这次调查由国家科技部统一组织，国家教育部及国家卫生健康委员会批准。主要是了解居民脑出血的发病和防控的相关情况，为国家制定卫生政策提供信息，为公众脑出血的防控提供参考，希望得到您的配合。所调查的内容仅用于相关的分析，我们将按照中华人民共和国《统计法》的要求，对您和您家人回答的问题加以保密。希望您能够参与并如实回答下面的问题，非常感谢您的合作！</p>\n\t\t<p style=\"color: red\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本项目通过中南大学湘雅医院伦理委员会审核批准。</p><br>"
					}
				},
				{
					type: "html",
					name: "question9",
					html: {
						"zh-cn": "<h5 style=\"color: red\">您是否同意接受该调查：</h5>"
					}
				},
				{
					type: "checkbox",
					isRequired: true,
					name: "是否同意接受该调查",
					title: {
						"zh-cn": "是否同意接受该调查"
					},
					titleLocation: "hidden",
					choices: ["同意"]
				},

				{
					type: "html",
					name: "question10",
					visibleIf: "{是否同意接受该调查} = [\"同意\"]",
					html: {
						"zh-cn": "\t\t<p class=\"lead\">填写说明</p>\n\t\t\n\t\t<p>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本调查表主要询问健康人群进行脑出血疾病的预防情况，请如实填写。本调查表由调查员询问本人填写，请选择与自身实际情况最为接近的选项，或在空格中真实填写相关信息。<br>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;再次感谢您的参与与支持！</p>"
					}
				},


				{
					type: "text",
					isRequired: true,
					name: "填表人签名",
					title: {
						"zh-cn": "本人签名"
					}
				},


				{
					type: "text",
					name: "填表人联系电话",
					title: {
						"zh-cn": "联系电话"
					},
					"isRequired": true,
					"validators": [{
						"type": "text",
						"minLength": 11,
						"maxLength": 11,
						"allowDigits": true,
						"text": "电话号码长度应该为11"
					}]
				},

				{
					type: "text",
					isRequired: true,
					name: "填表人填写日期",
					title: {
						"zh-cn": "填写日期"
					},
					inputType: "date"
				},
				{
					type: "text",
					isRequired: true,
					name: "登录账号",
					title: "问卷id",
					visible: false,
					"defaultValue": "1"
				},
				{
					type: "text",
					isRequired: true,
					name: "_id",
					title: "调查员id",
					visible: false,
					"defaultValue": "11"
				},


			]
		},
		{
			name: "问卷填写基本信息",
			elements: [


				{
					type: "text",
					name: "问卷类型",
					title: {
						"zh-cn": "问卷类型"
					},
					readOnly: true,
					"defaultValue": "C"
				},
				{
					type: "panel",
					name: "采样地址",
					elements: [{
							type: "dropdown",
							name: "所在的省",
							isRequired: true,
							title: "所在的省",
							// choices: ["Africa", "Americas", "Asia", "Europe", "Oceania"],
							choices: ["河南省", "湖南省", "湖北省", "安徽省", "江西省"]
						},
						{
							type: "dropdown",
							name: "所在的市",
							title: "所在的市",
							isRequired: true,
							choicesByUrl: {
								url: "http://39.98.237.59:8085/{所在的省}",
								valueName: "name"
							},

						},
						{
							type: "dropdown",
							name: "所在的县或区",
							title: "所在的县或区",
							isRequired: true,
							choicesByUrl: {
								url: "http://39.98.237.59:8086/{所在的市}",
								valueName: "name"
							}
						},
					]
				},

				// {type:"text",isRequired: true,name:"抽样点编号",title:"抽样点编号",inputType:"number"},
				{
					type: "dropdown",
					name: "抽样点编号",
					title: "抽样点编号",
					isRequired: true,
					choicesByUrl: {
						url: "http://www.ncxfbl.cn:8095/{所在的省}",
						valueName: "samplingCode"
					}
				},
				{
					"type": "text",
					"name": "标本编号",
					"title": {
						"zh-cn": "标本编号"
					},
					"isRequired": true,
				}

			],
			title: {
				default: "一、基本情况",
				"zh-cn": "问卷填写基本信息"
			},
		},
		{
			name: "一、基本情况",
			elements: [{
					type: "text",
					isRequired: true,
					name: "姓名",
					title: {
						"zh-cn": "姓名"
					}
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "性别",
					title: {
						"zh-cn": "性别"
					},
					choices: ["男", "女"]
				},
				{
					type: "text",
					isRequired: true,
					name: "出生日期",
					title: {
						"zh-cn": "出生日期"
					},
					inputType: "date",
					placeHolder: "年/月/日"
				},
				{
					type: "text",
					isRequired: true,
					name: "身份证号码",
					title: {
						"zh-cn": "身份证号码"
					},
					isRequired: true,
					"validators": [{
						"type": "text",
						"text": "身份证字段长度应该为18",
						"minLength": 18,
						"maxLength": 18,
						"allowDigits": true
					}],
				},
				{
					type: "text",
					isRequired: true,
					name: "身高",
					title: "身高（cm）",
					inputType: "number",
					placeHolder: "cm"
				},
				{
					type: "text",
					isRequired: true,
					name: "体重",
					title: "体重（kg）",
					inputType: "number",
					placeHolder: "kg"
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "民族",
					title: "民族",
					choices: ["汉族", "少数民族", "不详"]
				},

				{
					type: "panel",
					name: "户籍地址",
					elements: [{
							type: "dropdown",
							name: "户籍地址所在的省",
							isRequired: true,
							title: "户籍地址所在的省",
							// choices: ["Africa", "Americas", "Asia", "Europe", "Oceania"],
							choices: ["北京市", "广东省", "山东省", "江苏省", "河南省", "上海市", "河北省", "浙江省", "陕西省", "湖南省", "重庆市", "福建省", "天津市", "云南省", "四川省", "广西壮族自治区", "安徽省", "海南省", "江西省", "湖北省", "山西省", "辽宁省", "黑龙江省", "内蒙古自治区", "贵州省", "甘肃省", "青海省", "新疆维吾尔自治区", "西藏自治区", "吉林省", "宁夏回族自治区"]
						},
						{
							type: "dropdown",
							name: "户籍地址所在的市",
							title: "户籍地址所在的市",
							isRequired: true,
							choicesByUrl: {
								url: "http://39.98.237.59:8085/{户籍地址所在的省}",
								valueName: "name"
							},

						},
						{
							type: "dropdown",
							name: "户籍地址所在的县(区)",
							title: "户籍地址所在的县(区)",
							isRequired: true,
							choicesByUrl: {
								url: "http://39.98.237.59:8086/{户籍地址所在的市}",
								valueName: "name"
							}
						},
					]
				},
				{
					type: "text",
					name: "户籍地址所在的镇(乡)",
					title: "户籍地址所在的镇(乡)",
					isRequired: true
				},
				{
					type: "text",
					name: "户籍地址所在的街道(村)",
					title: "户籍地址所在的街道(村)",
					isRequired: true
				},
				{
					type: "text",
					name: "户籍地址所在的居委会(组)",
					title: "户籍地址所在的居委会(组)",
					isRequired: true
				},
				{
					type: "panel",
					name: "现居住址",

					elements: [{
							type: "dropdown",
							name: "现居住址所在的省",
							isRequired: true,
							title: "现居住址所在的省",
							// choices: ["Africa", "Americas", "Asia", "Europe", "Oceania"],
							choices: ["北京市", "广东省", "山东省", "江苏省", "河南省", "上海市", "河北省", "浙江省", "陕西省", "湖南省", "重庆市", "福建省", "天津市", "云南省", "四川省", "广西壮族自治区", "安徽省", "海南省", "江西省", "湖北省", "山西省", "辽宁省", "黑龙江省", "内蒙古自治区", "贵州省", "甘肃省", "青海省", "新疆维吾尔自治区", "西藏自治区", "吉林省", "宁夏回族自治区"]
						},
						{
							type: "dropdown",
							name: "现居住址所在的市",
							title: "现居住址所在的市",
							isRequired: true,
							choicesByUrl: {
								url: "http://39.98.237.59:8085/{现居住址所在的省}",
								valueName: "name"
							},

						},
						{
							type: "dropdown",
							name: "现居住址所在的县(区)",
							title: "现居住址所在的县(区)",
							isRequired: true,
							choicesByUrl: {
								url: "http://39.98.237.59:8086/{现居住址所在的市}",
								valueName: "name"
							}
						},
					]
				},
				{
					type: "text",
					name: "现居住址所在的镇(乡)",
					title: "现居住址所在的镇(乡)",
					isRequired: true
				},
				{
					type: "text",
					name: "现居住址所在的街道(村)",
					title: "现居住址所在的街道(村)",
					isRequired: true
				},
				{
					type: "text",
					name: "现居住址所在的居委会(组)",
					title: "现居住址所在的居委会(组)",
					isRequired: true
				},

				{
					type: "text",
					isRequired: true,
					name: "家庭人口数",
					title: "家庭人口数(人)",
					inputType: "number",
					placeHolder: "人"
				},

				{
					type: "radiogroup",
					isRequired: true,
					name: "婚姻",
					title: "婚姻",
					choices: ["未婚", "已婚", "离婚", "丧偶"]
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "文化程度",
					title: "文化程度",
					choices: ["大学本、专科或以上", "高中（包括中专）", "初中", "小学", "文盲", "不详"],
					colCount: 2
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "职业",
					title: "职业",
					choices: ["国家公务员", "专业技术人员", "职员", "企业管理人员", "工人", "农民", "学生", "现役军人", "自由职业者", "个体经营者", "无业人员", "离（退）休人员", "其他"],
					colCount: 3
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "家庭人均月收入",
					title: "家庭人均月收入",
					choices: ["500元以下", "500-1000元", "1001-3000元", "3001-5000元", "5001-10000元", "10000元以上", "不详"],
					colCount: 2
				},
				{
					type: "checkbox",
					isRequired: true,
					name: "医保类型（可多选）",
					title: {
						default: "主要医疗付费方式（可多选）",
						"zh-cn": "医保类型（可多选）"
					},
					choices: ["城镇职工医保", "城镇居民/城乡居民医保", "新农合/城乡居民医保", "商业保险", "公费医疗", "自费", "其他"],
					colCount: 2
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "是否办有医疗救助",
					title: {
						"zh-cn": "是否办有医疗救助"
					},
					choices: ["是", "否", "不知道"]
				},
			],
			title: {
				default: "二、基本情况",
				"zh-cn": "一、基本情况"
			},
		},
		{
			name: "二、生活方式",
			elements: [{
					type: "radiogroup",
					isRequired: true,
					name: "吸烟史",
					title: "吸烟史          (吸烟：每日吸烟≥1支)",
					choices: ["有", "无", "不知道"]
				},

				{
					type: "text",
					isRequired: true,
					name: "烟龄",
					visibleIf: "{吸烟史} = \"有\"",
					title: "烟龄",
					inputType: "number",
					placeHolder: "年"
				},
				{
					type: "text",
					isRequired: true,
					name: "吸烟量",
					visibleIf: "{吸烟史} = \"有\"",
					title: "吸烟量",
					inputType: "number",
					placeHolder: "支/天"
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "目前是否戒烟",
					visibleIf: "{吸烟史} = \"有\"",
					title: "目前是否戒烟",
					choices: ["是", "否"],
					otherText: "已戒烟"
				},
				{
					type: "text",
					isRequired: true,
					name: "已戒烟多少年",
					visibleIf: "{目前是否戒烟} = \"是\" and {吸烟史} = \"有\"",
					title: "已戒烟多少年",
					inputType: "number",
					placeHolder: "年"
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "是否被动吸烟",
					title: {
						"zh-cn": "是否被动吸烟          (被动吸烟：指不吸烟者吸入吸烟者呼出的烟雾及卷烟燃烧产生的烟雾，也称为“非自愿吸烟”，或“吸二手烟”)"
					},
					choices: ["是", "否", "不知道"]
				},

				{
					type: "radiogroup",
					isRequired: true,
					name: "饮酒史",
					title: "饮酒史          (饮酒：每周饮酒≥1次，不管饮酒量多少)",
					choices: ["有", "无", "不详"]
				},
				{
					type: "text",
					isRequired: true,
					name: "酒龄",
					visibleIf: "{饮酒史} = \"有\"",
					title: "酒龄",
					inputType: "number",
					placeHolder: "年"
				},



				{
					type: "checkbox",
					isRequired: true,
					name: "饮酒种类（可多选）",
					visibleIf: "{饮酒史} = \"有\"",
					title: "饮酒种类（可多选）",
					choices: ["啤酒", "白酒", "红酒", "米酒", "其他"]
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "目前是否戒酒",
					visibleIf: "{饮酒史} = \"有\"",
					title: "目前是否戒酒",
					choices: ["是", "否"]
				},
				{
					type: "text",
					isRequired: true,
					name: "已戒酒多少年",
					visibleIf: "{目前是否戒酒} = \"是\" and {饮酒史} = \"有\"",
					title: "已戒酒多少年",
					inputType: "number",
					placeHolder: "年"
				},
				// 				    			
				{
					type: "radiogroup",
					name: "体力活动",
					title: "体力活动",
					isRequired: true,
					choices: [{
						value: "轻度",
						text: {
							"zh-cn": "轻度（指长时间坐着或靠着工作、学习、阅读、看电视、用电脑、休息、做手工活、打牌等需要付出轻度体力，或未引起呼吸、心跳增加的活动）"
						}
					}, {
						value: "中度",
						text: {
							"zh-cn": "中度（指锯木头、洗衣服、打扫卫生、慢跑、骑车、跳舞等需要付出中等体力，或引起呼吸、心跳轻度增加的活动）"
						}
					}, {
						value: "重度",
						text: {
							"zh-cn": "重度（指搬运重物、挖掘、长跑、打球、跳健美操等需要付出较大体力，或引起呼吸、心跳显著增加的活动）"
						}
					}]
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "晚上一般几点睡觉",
					title: {
						"zh-cn": "晚上一般几点睡觉"
					},
					choices: ["10点前", "10-11点前", "11-12点前", "12点及12点后"]
				},
				{
					type: "dropdown",
					name: "晚上一般睡眠时长",
					isRequired: true,
					title: {
						"zh-cn": "晚上一般睡眠时长"
					},
					choices: ["4小时及4小时以下", "5小时", "6小时", "7小时", "8小时", "9小时", "10小时及以上"]
				},

				{
					type: "checkbox",
					isRequired: true,
					name: "膳食习惯（可多选）",
					title: {
						"zh-cn": "膳食习惯（可多选）"
					},
					choices: ["嗜咸", "嗜甜", "嗜辣", "嗜酸", "口味偏油", "口味适中", "口味较淡"],
					colCount: 2
				},
				{
					type: "html",
					name: "question1",
					html: {
						default: "<h4>食物食用频率：</h4>\n<p>您需要仔细的回忆在<u>过去的一年中</u>，您食用以下食物的频率</p>",
						"zh-cn": "<h4>食物食用频率：</h4>\n<p>您需要仔细的回忆在<b><u>过去的一年中</u></b>，您食用以下食物的频率</p>"
					}
				},


				{
					type: "radiogroup",
					isRequired: true,
					name: "食用水产品（包括鱼、虾、贝类、海带等）的频率是",
					title: {
						"zh-cn": "食用水产品（包括鱼、虾、贝类、海带等）的频率是"
					},
					choices: ["几乎不吃", "每月1-3次", "每周1-3次", "每周4-6次", "每天1-2次", "每天3次以上"],
					colCount: 2
				},


				{
					type: "radiogroup",
					isRequired: true,
					name: "食用蔬菜的频率是",
					title: {
						"zh-cn": "食用蔬菜的频率是"
					},
					choices: ["几乎不吃", "每月1-3次", "每周1-3次", "每周4-6次", "每天1-2次", "每天3次以上"],
					colCount: 2
				},


				{
					type: "radiogroup",
					isRequired: true,
					name: "食用水果的频率是",
					title: {
						"zh-cn": "食用水果的频率是"
					},
					choices: ["几乎不吃", "每月1-3次", "每周1-3次", "每周4-6次", "每天1-2次", "每天3次以上"],
					colCount: 2
				},


				{
					type: "radiogroup",
					isRequired: true,
					name: "食用奶及奶制品的频率是",
					title: {
						"zh-cn": "食用奶及奶制品的频率是"
					},
					choices: ["几乎不吃", "每月1-3次", "每周1-3次", "每周4-6次", "每天1-2次", "每天3次以上"],
					colCount: 2
				},


				{
					type: "radiogroup",
					isRequired: true,
					name: "食用辣椒的频率是",
					title: {
						"zh-cn": "食用辣椒的频率是"
					},
					choices: ["几乎不吃", "每月1-3次", "每周1-3次", "每周4-6次", "每天1-2次", "每天3次以上"],
					colCount: 2
				},

				{
					type: "radiogroup",
					isRequired: true,
					name: "食用熏制食品（包括熏肉、熏肝、熏鱼、熏蛋、熏豆腐干等）的频率是",
					title: {
						"zh-cn": "食用熏制食品（包括熏肉、熏肝、熏鱼、熏蛋、熏豆腐干等）的频率是"
					},
					choices: ["几乎不吃", "每月1-3次", "每周1-3次", "每周4-6次", "每天1-2次", "每天3次以上"],
					colCount: 2
				},


				{
					type: "radiogroup",
					isRequired: true,
					name: "食用腌制食品（包括腌制蘑菇、腌制腊肉、腌制腊肠、腌制酸菜、腌制咸鱼、腌制草莓、腌制香菜心、腌制生姜等）的频率是",
					title: {
						"zh-cn": "食用腌制食品（包括腌制蘑菇、腌制腊肉、腌制腊肠、腌制酸菜、腌制咸鱼、腌制草莓、腌制香菜心、腌制生姜等）的频率是"
					},
					choices: ["几乎不吃", "每月1-3次", "每周1-3次", "每周4-6次", "每天1-2次", "每天3次以上"],
					colCount: 2
				},

				{
					type: "checkbox",
					isRequired: true,
					name: "您家庭使用的油为（可多选）",
					title: "您家庭使用的油为（可多选）",
					hasOther: true,
					choices: ["菜籽油", "花生油", "大豆油", "猪油"],
					otherText: "其他"
				},
				{
					type: "multipletext",
					name: "油1",
					title: {
						"zh-cn": "家庭用油量"
					},
					items: [{
							name: "家庭每月用油",
							placeHolder: {
								"zh-cn": "斤"
							},
							isRequired: true,
							"inputType": "number",
							title: {
								"zh-cn": "家庭每月用油"
							}
						},
						{
							name: "多少人食用",
							placeHolder: {
								"zh-cn": "人"
							},
							isRequired: true,
							"inputType": "number",
							title: {
								"zh-cn": "多少人食用"
							}
						},
					]
				},


			],
			title: {
				default: "三、脑出血发病前生活方式",
				"zh-cn": "二、生活方式"
			},
		},
		{
			name: "三、相关因素调查",
			elements: [{
					type: "panel",
					name: "panel1",
					elements: [{
							type: "radiogroup",
							isRequired: true,
							name: "是否有过脑梗死",
							title: {
								default: "发病以前是否有过脑卒中",
								"zh-cn": "是否有过脑梗死"
							},
							choices: ["是", "否", "不知道"]
						},
						{
							type: "text",
							isRequired: true,
							name: "首次脑梗死发病时间",
							visibleIf: "{是否有过脑梗死} = \"是\"",
							title: {
								"zh-cn": "首次脑梗死发病时间"
							},
							inputType: "date",
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "是否规律服用抗血小板聚集药物",
							visibleIf: "{是否有过脑梗死} = \"是\"",
							title: "是否规律服用抗血小板聚集药物",
							choices: ["是", "否", "不知道"]
						},
						{
							type: "checkbox",
							isRequired: true,
							name: "抗血小板聚集药物类型",
							visibleIf: "{是否规律服用抗血小板聚集药物} = \"是\" and {是否有过脑梗死} = \"是\"",
							title: "药物类型（可多选）",
							choices: ["阿司匹林", "氯吡格雷", "西洛他唑", "其他", "不知道"]
						}
					]
				},
				{
					type: "panel",
					name: "panel2",
					elements: [{
							type: "radiogroup",
							isRequired: true,
							name: "是否知道自己的血压",
							title: "是否知道自己的血压",
							choices: ["是", "否"]
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "既往有无高血压病史",
							visibleIf: "{是否知道自己的血压} = \"是\"",
							title: "既往有无高血压病史         (高血压：既往明确诊断或收缩压≥140mmHg或舒张压≥90mmHg)",
							choices: ["有", "无", "不知道"]
						},


						{
							type: "text",
							isRequired: true,
							name: "高血压病史年限",
							visibleIf: "{既往有无高血压病史} = \"有\" and {是否知道自己的血压} = \"是\"",
							title: {
								"zh-cn": "高血压病史年限"
							},
							inputType: "number",
							placeHolder: {
								"zh-cn": "年"
							}
						},
						//	{type:"text",name:"最高血压",visibleIf:"{既往有无高血压病史} = \"有\"",title:{"zh-cn":"最高血压"},placeHolder:{"zh-cn":"_____/____mmHg"}},
						{
							type: "panel",
							name: "最高血压",
							title: "最高血压",
							visibleIf: "{既往有无高血压病史} = \"有\" and {是否知道自己的血压} = \"是\"",
							elements: [{
									type: "text",
									isRequired: true,
									name: "最高血压1",
									width: "100px",
									titleLocation: "hidden",
									inputType: "number"
								},
								{
									type: "text",
									isRequired: true,
									name: "question20",
									width: "70px",
									startWithNewLine: false,
									readOnly: true,
									titleLocation: "hidden",
									placeHolder: "/"
								},
								{
									type: "text",
									isRequired: true,
									name: "最高血压2",
									width: "100px",
									inputType: "number",
									startWithNewLine: false,
									titleLocation: "hidden"
								},
								{
									type: "text",
									isRequired: true,
									name: "question22",
									width: "100px",
									startWithNewLine: false,
									readOnly: true,
									titleLocation: "hidden",
									placeHolder: "mmHg"
								}
							]
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "是否规律测量血压",
							visibleIf: "{既往有无高血压病史} = \"有\" and {是否知道自己的血压} = \"是\"",
							title: "是否规律测量血压         (规律测量血压定义：高血压患者至少每周测量1次血压)",
							choices: ["是", "否"]
						},
						{
							type: "panel",
							name: "血压控制范围",
							title: "血压控制范围：",
							visibleIf: "{是否规律测量血压} = \"是\" and {既往有无高血压病史} = \"有\"and {是否知道自己的血压} = \"是\"",
							elements: [{
									"type": "dropdown",
									isRequired: true,
									"name": "血压控制范围1",
									"width": "200px",
									"titleLocation": "hidden",
									"choices": ["90-100", "101-110", "111-120", "121-130", "131-140", "141-150", "151-160", "161-170", "171-180", "180及以上", ]
								},
								{
									"type": "text",
									"name": "question2",
									"width": "70px",
									"startWithNewLine": false,
									"readOnly": true,
									"titleLocation": "hidden",
									"placeHolder": "/"
								},
								{
									"type": "dropdown",
									isRequired: true,
									"name": "血压控制范围2",
									"width": "200px",
									"startWithNewLine": false,
									"titleLocation": "hidden",
									"choices": ["60以下", "61-70", "71-80", "81-90", "91-100", "101-110", "111-120", "120以上", ]
								},
								{
									"type": "text",
									"name": "question2",
									"width": "100px",
									"startWithNewLine": false,
									"readOnly": true,
									"titleLocation": "hidden",
									"placeHolder": "mmHg"
								},

							],
						},

						{
							type: "radiogroup",
							isRequired: true,
							name: "是否规律服用降压药",
							visibleIf: "{既往有无高血压病史} = \"有\" and {是否知道自己的血压} = \"是\"",
							title: "是否规律服用降压药",
							choices: ["是", "否"]
						}
					]
				},
				{
					type: "panel",
					name: "panel3",
					elements: [{
							type: "radiogroup",
							isRequired: true,
							name: "是否测量过血脂",
							title: {
								"zh-cn": "是否测量过血脂"
							},
							choices: ["是", "否"]
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "血脂范围",
							visibleIf: "{是否测量过血脂} = \"是\"",
							title: "血脂范围",
							choices: ["偏高", "偏低", "正常", "不知道"]
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "是否规律服用调脂药",
							visibleIf: "{血脂范围} = \"偏高\" and {是否测量过血脂} = \"是\"",
							title: "是否规律服用调脂药",
							choices: ["是", "否"]
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "调脂药物类型",
							visibleIf: "{是否规律服用调脂药} = \"是\" and {血脂范围} = \"偏高\" and {是否测量过血脂} = \"是\"",
							title: "药物类型",
							choices: ["他汀类", "其他", "不知道"]
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "目前血脂是否正常",
							visibleIf: "{血脂范围} = \"偏高\" and {是否测量过血脂} = \"是\"",
							title: "目前血脂是否正常",
							choices: ["是", "否", "不知道"]
						},
					]
				},

				{
					type: "panel",
					name: "panel4",
					elements: [{
							type: "radiogroup",
							isRequired: true,
							name: "以前是否测量血糖",
							title: "以前是否测量血糖",
							choices: ["是", "否"]
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "血糖范围",
							visibleIf: "{以前是否测量血糖} = \"是\"",
							title: "血糖范围           (血糖偏高：空腹血糖≥7.0mmol/l；或餐后2小时血糖≥11.1mmol/l)",
							choices: ["偏高", "偏低", "正常", "不知道"]
						},

						{
							type: "radiogroup",
							isRequired: true,
							name: "是否规律监测血糖",
							visibleIf: "{血糖范围} = \"偏高\" and {以前是否测量血糖} = \"是\"",
							title: "是否规律监测血糖",
							choices: ["是", "否"]
						},
						{
							type: "panel",
							name: "血糖控制范围",
							title: "血糖控制范围",
							visibleIf: "{是否规律监测血糖} = \"是\" and {血糖范围} = \"偏高\" and {以前是否测量血糖} = \"是\"",
							elements: [{

									type: "text",
									name: "血糖控制范围1",
									width: "100px",
									inputType: "number",
									isRequired: true,
									titleLocation: "hidden"
								},
								{
									type: "text",
									name: "question20",
									width: "70px",
									startWithNewLine: false,
									readOnly: true,
									titleLocation: "hidden",
									placeHolder: "~"
								},
								{
									type: "text",
									name: "血糖控制范围2",
									width: "100px",
									inputType: "number",
									isRequired: true,
									startWithNewLine: false,
									titleLocation: "hidden"
								},
								{
									type: "text",
									name: "question22",
									width: "100px",
									startWithNewLine: false,
									readOnly: true,
									titleLocation: "hidden",
									placeHolder: "mmol/l"
								}

							]
						},


						{
							type: "radiogroup",
							isRequired: true,
							name: "是否规律服用降糖药",
							visibleIf: "{血糖范围} = \"偏高\" and {以前是否测量血糖} = \"是\"",
							title: "是否规律服用降糖药",
							choices: ["是", "否"]
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "是否使用胰岛素",
							visibleIf: "{血糖范围} = \"偏高\" and {以前是否测量血糖} = \"是\"",
							title: "是否使用胰岛素",
							choices: ["是", "否"]
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "是否存在糖尿病慢性并发症",
							visibleIf: "{血糖范围} = \"偏高\" and {以前是否测量血糖} = \"是\"",
							title: "是否存在糖尿病慢性并发症",
							choices: ["是", "否"],
							otherText: "其他"
						},
						{
							type: "checkbox",
							isRequired: true,
							name: "何种并发症",
							visibleIf: "{是否存在糖尿病慢性并发症} = \"是\" and  {血糖范围} = \"偏高\" and {以前是否测量血糖} = \"是\"",
							title: {
								"zh-cn": "何种并发症（可多选）"
							},
							choices: ["糖尿病肾病", "糖尿病眼部并发症", "糖尿病足", "糖尿病周围神经病变", "其他", "不知道"],
							otherText: {
								"zh-cn": "其他"
							},
							colCount: 2
						},
					],
				},
				{
					type: "panel",
					name: "panel5",
					elements: [{
							type: "radiogroup",
							isRequired: true,
							name: "心房颤动病史",
							title: "心房颤动病史           (心房颤动：心电图明确诊断)",
							choices: ["有", "无", "不知道"]
						},

						{
							type: "radiogroup",
							isRequired: true,
							name: "是否规律使用抗凝药物",
							visibleIf: "{心房颤动病史} = \"有\"",
							title: "是否规律使用抗凝药物",
							choices: ["是", "否"]
						},
						{
							type: "text",
							isRequired: true,
							name: "使用时长1",
							visibleIf: "{是否规律使用抗凝药物} = \"是\" and {心房颤动病史} = \"有\"",
							inputType: "number",
							title: "使用时长",
							placeHolder: "年"
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "抗凝药物类型",
							visibleIf: "{是否规律使用抗凝药物} = \"是\" and {心房颤动病史} = \"有\"",
							title: "药物类型",
							hasOther: true,
							choices: ["华法令", "新型抗凝药物", "低分子肝素", "普通肝素", "不知道"],
							otherText: "其他",
							colCount: 2
						},
						{
							type: "radiogroup",
							isRequired: true,
							name: "是否定期监测凝血功能",
							visibleIf: "{心房颤动病史} = \"有\"",
							title: "是否定期监测凝血功能",
							choices: ["是", "否"]
						}
					]
				},
				{
					type: "panel",
					name: "panel6",
					elements: [{
							type: "radiogroup",
							isRequired: true,
							name: "冠心病病史",
							title: "冠心病病史          (冠心病：既往在医院明确诊断有心肌梗死或心绞痛发作病史)",
							choices: ["有", "无", "不知道"]
						},

						{
							type: "radiogroup",
							isRequired: true,
							name: "是否规律服用药物",
							visibleIf: "{冠心病病史} = \"有\"",
							title: "是否规律服用药物",
							choices: ["是", "否"]
						}
					],
				},
				{
					type: "checkbox",
					isRequired: true,
					name: "长期服用其他药物史（可多选）",
					title: {
						"zh-cn": "长期服用其他药物史（可多选）"
					},
					hasOther: true,
					choices: ["止痛药", "避孕药", "减肥药", "兴奋剂", "无"],
					otherText: "其他",
					colCount: 2
				},
				{
					"type": "matrixdynamic",
					"name": "长期服用药物的具体情况",
					"visibleIf": "{长期服用其他药物史（可多选）} <> [\"无\"]",
					"title": "药物具体情况",
					"columns": [{
							"name": "药物名称",
							"title": " 药物名称",
							"cellType": "text"
						},
						{
							"name": "服药时长",
							"title": "服药时长",
							"cellType": "text"
						}
					],
					"rowCount": 1,
					"confirmDelete": true,
					"confirmDeleteText": "确认删除",
					"addRowText": "添加",
					"removeRowText": "删除"
				},



				{
					type: "radiogroup",
					isRequired: true,
					name: "夜间睡觉是否打呼噜",
					title: "夜间睡觉是否打呼噜",
					choices: ["是", "否"]
				},
			],
			title: {
				default: "四、脑出血发病前相关因素调查",
				"zh-cn": "三、相关因素调查"
			},
		},
		{
			name: "四、您是否曾接受过以下健康宣教，请按照实际情况勾选。",
			elements: [{
					type: "radiogroup",
					isRequired: true,
					name: "戒烟教育",
					title: "戒烟教育",
					choices: ["有", "无"]
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "限酒教育",
					title: "限酒教育",
					choices: ["有", "无"]
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "控制体重教育",
					title: "控制体重教育",
					choices: ["有", "无"]
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "低盐饮食教育",
					title: "低盐饮食教育",
					choices: ["有", "无"]
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "低脂饮食教育",
					title: "低脂饮食教育",
					choices: ["有", "无"]
				},
				{
					type: "radiogroup",
					isRequired: true,
					name: "糖尿病健康教育",
					title: "糖尿病健康教育",
					choices: ["有", "无"]
				},
				{
					type: "checkbox",
					isRequired: true,
					name: "您是否接受过脑卒中（即中风）教育和/或以下材料（可多选）",
					title: {
						default: "您是否接受过卒中教育和/或以下材料（可多选）",
						"zh-cn": "您是否接受过脑卒中（即中风）教育和/或以下材料（可多选）"
					},
					choices: ["告知患者积极控制卒中危险因素", "告知患者如何识别卒中发作症状", "告知患者卒中再发后要快速拨打“120”或“999”电话救助", "告知患者如何服用二级预防用药以及服药原因", "告知患者应定期复查", "从未接受过上述教育"]
				},
				{
					type: "checkbox",
					isRequired: true,
					name: "您获取上述信息的渠道（可多选）",
					title: "您获取上述信息的渠道（可多选）",
					hasOther: true,
					choices: ["社区", "医护人员", "电视", "网络", "他人介绍", "不知道"],
					otherText: "其他",
					colCount: 2
				}
			],
			title: {
				default: "五、接受健康宣教情况",
				"zh-cn": "四、您是否曾接受过以下健康宣教，请按照实际情况勾选。"
			},
		},
		{
			name: "五、体检检验、检查结果",
			elements: [{
					type: "text",
					isRequired: true,
					name: "收缩压",
					title: {
						"zh-cn": "收缩压（mmHg）"
					},
					inputType: "number",
					placeHolder: ""
				},
				{
					type: "text",
					isRequired: true,
					name: "舒张压",
					title: {
						"zh-cn": "舒张压（mmHg）"
					},
					inputType: "number",
					placeHolder: ""
				},
				{
					type: "text",
					isRequired: true,
					name: "心率",
					title: {
						"zh-cn": "心率（次/分）"
					},
					inputType: "number",
					placeHolder: ""
				},
				{
					type: "text",
					isRequired: true,
					name: "脉搏",
					title: {
						"zh-cn": "脉搏（次/分）"
					},
					inputType: "number",
					placeHolder: ""
				},
				{
					type: "multipletext",
					name: "血常规检测",
					title: "血常规检测（入院时）",
					items: [{
							name: "白细胞",
							isRequired: true,
							title: {
								"zh-cn": "白细胞(10^9/L)"
							}
						},
						{
							name: "中性粒细胞百分比",
							isRequired: true,
							title: "中性粒细胞百分比(%)"
						},
						{
							name: "中性粒细胞计数",
							isRequired: true,
							title: "中性粒细胞计数(10^9/L)"
						},
						{
							name: "淋巴细胞百分比",
							isRequired: true,
							title: "淋巴细胞百分比(%)"
						},
						{
							name: "淋巴细胞计数",
							isRequired: true,
							title: "淋巴细胞计数(10^9/L)"
						},
						{
							name: "红细胞",
							isRequired: true,
							title: "红细胞(10^12/L)"
						},
						{
							name: "血红蛋白",
							isRequired: true,
							title: "血红蛋白(g/L) "
						},
						{
							name: "血小板",
							isRequired: true,
							title: "血小板(10^9/L)"
						},
					],
					colCount: 2
				},

				{
					type: "multipletext",
					name: "血生化检测",
					title: "血生化检测（入院时）",
					items: [{
							name: "血生化检测-谷丙转氨酶",
							isRequired: true,
							title: {
								"zh-cn": "谷丙转氨酶(U/L)"
							}
						},
						{
							name: "血生化检测-谷草转氨酶",
							isRequired: true,
							title: "谷草转氨酶(U/L)"
						},
						{
							name: "血生化检测-白蛋白",
							isRequired: true,
							title: "白蛋白(g/L)"
						},
						{
							name: "血生化检测-球蛋白",
							isRequired: true,
							title: "球蛋白(g/L)"
						},
						{
							name: "血生化检测-血肌酐",
							isRequired: true,
							title: "血肌酐(umol/l)"
						},
						{
							name: "血生化检测-血尿素氮",
							isRequired: true,
							title: "血尿素氮(mmol/l)"
						},
						{
							name: "血生化检测-尿酸",
							isRequired: true,
							title: "尿酸(umol/l)"
						},
						{
							name: "血生化检测-同型半胱氨酸",
							isRequired: true,
							title: "同型半胱氨酸(umol/l)"
						},

						{
							name: "血生化检测-空腹血糖",
							isRequired: true,
							title: {
								"zh-cn": "空腹血糖(mmol/l)"
							}
						},
						{
							name: "血生化检测-糖化血红蛋白",
							isRequired: true,
							title: "糖化血红蛋白(%)"
						},
						{
							name: "血生化检测-甘油三酯",
							isRequired: true,
							title: "甘油三酯(mmol/l)"
						},
						{
							name: "血生化检测-胆固醇",
							isRequired: true,
							title: "胆固醇(mmol/l)"
						},
						{
							name: "血生化检测-高密度脂蛋白",
							isRequired: true,
							title: "高密度脂蛋白(mmol/l)"
						},
						{
							name: "血生化检测-低密度脂蛋白",
							isRequired: true,
							title: "低密度脂蛋白(mmol/l)"
						},
					],
					colCount: 2
				},
				{
					type: "multipletext",
					name: "凝血常规检测",
					title: "凝血常规检测（入院时）",
					items: [{
							name: "凝血常规检测-凝血酶原时间",
							isRequired: true,
							title: {
								"zh-cn": "凝血酶原时间(s)"
							}
						},
						{
							name: "凝血常规检测-国际标准化比值",
							isRequired: true,
							title: "国际标准化比值"
						},
						{
							name: "凝血常规检测-活化部分凝血活酶时间",
							isRequired: true,
							title: "活化部分凝血活酶时间(s)"
						},
						{
							name: "凝血常规检测-凝血酶时间",
							isRequired: true,
							itle: "凝血酶时间(s)"
						},
						{
							name: "凝血常规检测-纤维蛋白原",
							isRequired: true,
							title: "纤维蛋白原(g/l)"
						},
						{
							name: "凝血常规检测-D-二聚体",
							isRequired: true,
							title: "D-二聚体(mg/l)"
						},
						{
							name: "凝血常规检测-血浆纤溶酶原抗原测定",
							isRequired: true,
							title: "血浆纤溶酶原抗原测定(mg/l)"
						},
						{
							name: "凝血常规检测-血浆抗凝血酶III抗原测定",
							isRequired: true,
							title: "血浆抗凝血酶III抗原测定(mg/l)"
						},
					],
					colCount: 2
				},

				{
					type: "text",
					name: "心电图结果",
					isRequired: true,
					title: {
						"zh-cn": "心电图结果"
					}
				},

				{
					type: "text",
					name: "颈部血管彩超结果",
					isRequired: true,
					title: {
						"zh-cn": "颈部血管彩超结果"
					}
				},
				{
					type: "text",
					name: "头部CT/CTA结果：",
					isRequired: true,
					title: {
						"zh-cn": "头部CT/CTA结果："
					}
				},
				{
					type: "html",
					name: "感谢您的支持与配合",
					html: {
						"zh-cn": "<div><b>感谢您的支持与配合!</b></div>"
					}
				},
				{
					type: "text",
					name: "调查员签字",
					isRequired: true,
					title: {
						"zh-cn": "调查员签字"
					}
				},
				{
					type: "text",
					name: "调查日期",
					isRequired: true,
					title: {
						"zh-cn": "调查日期"
					},
					inputType: "date"
				},

				{
					"type": "html",
					"name": "是否还需再次编辑",
					"html": {
						"zh-cn": "<h5 style=\"color: red\">是否需要再次编辑:(注：如果问卷中填写的数据已经确定，请选择否，若还需要更改数据，请选择是)</h5>"
					}
				},

				{
					"type": "radiogroup",
					"name": "是否需要再次编辑",
					"title": {
						"zh-cn": "是否需要再次编辑"
					},
					"isRequired": true,
					"choices": ["是", "否"],
					"titleLocation": "hidden",
				},
			],
			title: {
				"zh-cn": "五、体检检验、检查结果"
			},
		},
		// 							
	],
	"clearInvisibleValues": "onHidden"
}

//创建localStorage缓存方法，存储问卷数据
var queStorage = window.localStorage

// 在页面创建时，向后台发送请求，创建问卷实体，分配ID等信息。
window.onload = function () {
    /* 
        在打开一个新的页面时，首先要判断当前是否有缓存que：
            如果有缓存，说明上次用户尚未填写完成，读取缓存中的数据
            如果没有缓存，则填写一份新的问卷，请求后台创建问卷对象 
    */
    if (queStorage.getItem(username.textContent + "que4") != null) {
        //有缓存，读取缓存
        //从字符串转化为json格式
        var queStr = queStorage.getItem(username.textContent + "que4")
        var queJson = JSON.parse(queStr)
        //遍历queJson，进行赋值
        Object.keys(queJson).forEach((key, i) => {
            survey.setValue(key, queJson[key])
        })
    } 
};

//根据JSON文件创建问卷实体
var survey = new Survey.Model(surveyJSON);

$("#surveyContainer").Survey({
    model: survey,
    //在问卷填写完成，提交时，进行调用这个函数，提交所有数据,进行写入
    onComplete: function (survey) {
        console.log(survey.data);
        $.ajax({
            url: "/pcpages/submitQue4/",
            type: "post",
            dataType: "json",
            contentType: "application/json;charset=utf-8",
            data: JSON.stringify(survey.data),
            success: function (data) {
                console.log("数据录入成功");
                //成功发送后，删除缓存。
                queStorage.removeItem(username.textContent + 'que4')
				window.location.href="/index/"
            },
        });
    },
});

// 该函数实现填一个判断一个，判断的是有范围的，比如说电话号码长度
survey.checkErrorsMode = "onValueChanged";

survey.sendResultOnPageNext = true;


//当页面切换时，保存用户的写入数据
survey.onPartialSend.add(function (survey) {
    queStorage.setItem(username.textContent + "que4", JSON.stringify(survey.data))
   
});